<!DOCTYPE HTML>
<html>
<head>
    <meta charset="utf-8">
    <meta name="renderer" content="webkit|ie-comp|ie-stand">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
    <meta http-equiv="Cache-Control" content="no-siteapp" />
    <link rel="stylesheet" type="text/css" href="__CSS__/main.css" />
    <link rel="stylesheet" type="text/css" href="__CSS__/common.css" />
    <link rel="stylesheet" type="text/css" href="__CSS__/bootstrap.min.css" />
    <link href="//cdn.bootcss.com/bootstrap-validator/0.5.3/css/bootstrapValidator.min.css" rel="stylesheet">
    <script src="//cdn.bootcss.com/bootstrap-validator/0.5.3/js/bootstrapValidator.min.js"></script>
    <!-- <link rel="stylesheet" type="text/css" href="__EXTEND__/static/h-ui.admin/css/H-ui.admin.css" />-->
    <![endif]-->
    <title>添加担保人</title>
</head>
<body>
<div class="contant">
<div class="row">
<!--        <div class="top">首页>添加担保人</div>-->
        <form id="registerForm" action="{:U('addAssure')}" method="post" enctype="multipart/form-data" class="form-horizontal">
        <div class="content addapply">
            <div class="box larg-box">
                <h1>添加担保人<span>(标*为必填项)</span></h1>
                <div class="list-block">
                    <div class="row">
                        <label>姓名: <i class="required">*</i></label>
                        <input type="text" name="user_name">
                        <input type="hidden" name="user_id" value={$_GET['user_id']}>
                        <label>身份证号: <i class="required">*</i></label>
                        <input type="text" name="identity_no" maxlength="18" style="width: 200px;">
                        <label>手机号: <i class="required">*</i></label>
                        <input type="text" name="telephone" maxlength="18" style="width: 200px;">
                    </div>
                    <div class="row">
                        <label>上传照片: <i class="required">*</i></label>
                        <label class="inputfile" for="">
                            <input class="upload" name="assure_id_photo_pros" accept="image/*" type="file" style="display: none"/><i>身份证正面</i>
                            <img class="pic" src="http://{$_SERVER['HTTP_HOST']}/Uploads/{$userInfo.assure_id_photo_pros}" >
                        </label>
                        <label class="inputfile" for="">
                            <input class="upload" name="assure_id_photo_cons" accept="image/*" type="file" style="display: none"/><i>身份证反面</i>
                            <img class="pic" src="http://{$_SERVER['HTTP_HOST']}/Uploads/{$userInfo.assure_id_photo_cons}" >
                        </label>
                        <label class="inputfile" for="">
                            <input class="upload" name="assume_credit_photo" accept="image/*" type="file" style="display: none"/><i>提交征信授权书</i>
                            <img class="pic" src="http://{$_SERVER['HTTP_HOST']}/Uploads/{$userInfo.assume_credit_photo}" >
                        </label>
                        <label class="inputfile" for="">
                            <input class="upload" name="credit_up_photo" accept="image/*" type="file" style="display: none"/><i>征信授权书抬头照</i>
                            <img class="pic" src="http://{$_SERVER['HTTP_HOST']}/Uploads/{$userInfo.credit_up_photo}" >
                        </label>
                        <!--<label class="inputfile" for="">-->
                            <!--<input class="upload" name="credit_down_photo" accept="image/*" type="file" style="display: none"/><i>征信授权书低头照</i>-->
                            <!--<img class="pic" src="http://{$_SERVER['HTTP_HOST']}/Uploads/{$userInfo.credit_down_photo}" >-->
                        <!--</label>-->
                    </div>
                </div>
            </div>
            <div class="box">
                <h1>操作</h1>
                <div class="list-block">
                    <input id="sub-frm" type="button" class="button01" value="提交" name="">
                    <input id="non-sub" type="button" class="button01" value="保存不提交" name="">
                </div>
            </div>
        </div>
        </form>
    </div>
</div>
<script type="text/javascript" src="__EXTEND__/lib/jquery/1.9.1/jquery.min.js"></script>
<script type="text/javascript" src="__EXTEND__/static/h-ui/js/H-ui.min.js"></script>
<script type="text/javascript" src="__EXTEND__/lib/layer/2.4/layer.js"></script>
<script type="text/javascript" src="__EXTEND__/static/h-ui.admin/js/H-ui.admin.js"></script>
<style type="text/css">
    i{cursor: pointer;}
   .pic{
        width:142px;
        height:120px;
        border-radius:0% ;
        cursor: pointer;
        background: #fff;
        /*position: absolute;
        */z-index: 1;
        }
</style>

<script type="text/javascript">
    $('#non-sub').click(function(){
        $('#status').val(0);
        $('#registerForm').submit();
    });

    $('#sub-frm').click(function(){
        $('#registerForm').submit();

        // $.ajax({
        //    type: "POST",
        //    url: "__URL__/validate",
        //    data: {
        //         identity_no:$('#identity_no').val(),
        //         spouse_name:$('#spouse_name').val(),
        //         spouse_identity_no:$('#spouse_identity_no').val()
        //     },
        //    success: function(msg){
        //         console.log(msg);
        //         if (msg.status == -1) {
        //             alert(msg.info);
        //             return false;
        //         }
        //             $('#registerForm').submit();
        //         // return true;
        //    }
        // });
    });

    $(function() {
        $("i").click(function (elm) {

        $(this).siblings('.upload').click();//隐藏了input:file样式后，点击头像就可以本地上传
        $(this).siblings('.upload').on("change",function(){
            var objUrl = getObjectURL(this.files[0]) ; //获取图片的路径，该路径不是图片在本地的路径
            if (objUrl) {
                $(this).siblings('.pic').attr("src", objUrl) ; //将图片路径存入src中，显示出图片
            }
            });
        });
    });
     
    //建立一個可存取到該file的url
    function getObjectURL(file) {
        var url = null ;
        if (window.createObjectURL!=undefined) { // basic
        url = window.createObjectURL(file) ;
        } else if (window.URL!=undefined) { // mozilla(firefox)
        url = window.URL.createObjectURL(file) ;
        } else if (window.webkitURL!=undefined) { // webkit or chrome
        url = window.webkitURL.createObjectURL(file) ;
        }
        return url ;
    }
</script>
<!-- 上传插件 -->
<script src="__PUBLIC__/Admin/js/imgUp.js"></script>
</body>
</html>